#pragma once
#include <math.h>

struct Vec3D
{
	float x,y,z;
	bool operator ==(Vec3D& other)
	{
		const float eps = .0000001f;
		return (fabs(other.x - x) < eps) && (fabs(other.y - y) < eps) && (fabs(other.z - z) < eps);
	}

	bool operator !=(Vec3D& other)
	{
		return !(*this == other);
	}

	Vec3D()
		:x(0), y(0), z(0)
	{

	}

	Vec3D(float x, float y, float z)
		:x(x), y(y), z(z)
	{

	}

	Vec3D(const Vec3D& first, const Vec3D& second)
	{
		x = second.x - first.x;
		y = second.y - first.y;
		z = second.z - first.z;
	}

	Vec3D &operator += (Vec3D& other)
	{
		x += other.x;
		y += other.y;
		z += other.z;
		return *this;
	}

	float Lenght()
	{
		return sqrt(x*x + y*y + z*z);
	}
};

struct Color
{
	int R, G, B;
	Color(int R, int G, int B)
		:R(R), G(G), B(B)
	{

	}

	Color()
		:R(0), G(0), B(0)
	{

	}
};